/**
 * Created by wanghuan on 2017/4/9.
 */

/*==========================header 相关接口==============================*/

import Ajax from '../../apiAjax';
var apiRoot = '/apiAccount'
export  default {
  state:{
    basicInfo:{}
  },
  mutations:{
    setCommonStateData(state,{key,data}){
      state[key] = data;
    },
  },
  actions:{
    getBasicInfo({commit},paramData){
    return new Promise((resolve, reject) => {
      Ajax({
        url:apiRoot+'/basic/getUserBasicInfo.do',
        data:paramData,
        success:function (data) {
          commit('setCommonStateData',{key:'basicInfo',data:data});
          resolve(data);
        }
      })
    })
  },

  },
  getters: {
    basicInfo:(state, getters)=> {
      return state.basicInfo;
    }
  }
}
